
//
//  Utils.h
//  Mockup
//	Used to define global types and constants
//
//  Created by Bernardo Quibiana
//  Copyright 2010 Mac-Easy@USC. All rights reserved.
//


// a point structure with int coordinates
struct point_t {
	NSInteger x;
	NSInteger y;
};

typedef enum {
	Easy, Medium, Hard
} difficulty_t;

typedef enum {
	North, East, South, West, NorthEast, SouthEast, NorthWest, SouthWest, None
} direction_t;

typedef enum {
	Red, Yellow, Blue, Green, Purple, Teal, Black, White, Empty
} tile_t;

typedef enum {
	Flip, Swap
} tileAnimation_t;

typedef enum {
	Starting, Running, Paused, Stopping, Over
} gamestate_t;

typedef enum {
	Loading, Matching, Animating, Idle
} boardstate_t;

typedef enum {
	PauseMenu = 10, GameOverrideAlert = 16, QuitConfirmation = 20, 
	NewHighScoreAlert = 30, NonHighScoreAlert = 40, DifficultySelector = 42, 
	UnamePrompt = 50, UnameErrorAlert = 60
} AlertViewTag_t;

// constants
// frame rectangle for the top left tile as seen by the user 
#define kStdTileFrame CGRectMake(0.0, 40.0, 40.0, 40.0);	//0.0, 38.0, 40.0, 38.25
// frame rectangle for the screen, resolution: 320x480
#define kScreenFrame CGRectMake(0.0, 0.0, 320.0, 480.0)

// time interval for the board-matching call loop
#define kBoardMatchDuration 1.00f
// time interval for tiles fall animation loop
#define kFallCycleDuration 0.65f;
// time interval for the tile flip animation lop
#define kTileFlipDuration 0.80f;
// time interval for the tile poof animation loop
#define kTilePoofDuration 0.50f;
// time interval for the tile fall animation loop
#define kTileFallDuration 0.01f;

// atomic distance for timed tile fall animation
#define kTileFallDistance 4;
// atomic distance for the tile adjustment animation
#define kTileMinAdjustShift 10;
// time lag between beteen inputs to allow for matching
#define kInputLagDuration 0.15;
// override tile logical update with animation update
#define kAnimateThenUpdate YES;
